<template>
  <j-modal
    :title="title"
    :width="width"
    :visible="visible"
    :maskClosable="false"
    switchFullscreen
    @ok="handleOk"
    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
    @cancel="handleCancel">
    <a-card :bordered="false">
      <div class="table-page-search-wrapper">
        <a-form layout="inline" @keyup.enter.native="handleOk">
          <a-row :gutter="24">
            <a-col :xl="24" :lg="24" :md="24" :sm="24">
              <a-form-item label="年度">
                <a-input placeholder="请输入年度" v-model="model.year"></a-input>
              </a-form-item>
            </a-col>
          </a-row>
        </a-form>
      </div>
    </a-card>
  </j-modal>
</template>

<script>


  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import { mixinDevice } from '@/utils/mixin'
  import { getAction } from '@api/manage'

  export default {
    name: 'VcaSelectPensionSupplyModal',
    mixins:[JeecgListMixin, mixinDevice],
    data() {
      return {
        model:{},
        title:'',
        width:600,
        visible: false,
        disableMixinCreated:true,
        disableSubmit: false,
        url: {
          queryPensionSupply:"/villageCadreAssist/vcaPensionSupply/queryPensionSupply",
        },
      }
    },
    methods:{
      init(record){
        this.model = Object.assign({},record);
        this.model["year"]=new Date().getFullYear();
        this.visible=true;
      },
      close () {
        this.$emit('close');
        this.visible = false;
      },
      submitCallback(){
        this.$emit('ok');
        this.visible = false;
      },
      handleCancel () {
        this.close()
      },
      handleOk(){
        getAction(this.url.queryPensionSupply,{
          residentId:this.model["resident"]["id"],
          year:this.model["year"]
        }).then((res)=>{
          if(res.success){
            fullParamData(res.result);
            this.visible = false;
          }else{
            this.$message.error(res.message);
          }
        });
      }
    }
  }
</script>

<style scoped>
</style>